package com.qingpeng.pay.service;

import android.app.Notification;

import com.qingpeng.pay.api.Host;
import com.qingpeng.pay.api.RedBag;
import com.qingpeng.pay.beans.NullBean;
import com.qingpeng.pay.okhttp.RetrofitCreateHelper;
import com.qingpeng.pay.utils.APP;


import java.util.HashMap;
import java.util.Map;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;


public class WechatNotificationHandle extends NotificationHandle{
        public WechatNotificationHandle(String pkgtype,Notification notification,IDoPost postpush){
                super(pkgtype,notification,postpush);
        }

        public void handleNotification(){
                if((title.contains("微信支付")|title.contains("微信收款"))&&content.contains("收款")){
                        Map<String,String> postmap=new HashMap<String,String>();
                        postmap.put("pay_time",notitime);
                        postmap.put("title",title);
                        postmap.put("tradeMoney",extractMoney(content));
                        postmap.put("content",content);
                        postmap.put("user_id", APP.uid);
//                        postpush.doPost(postmap);
                        Call<NullBean> postceshi = RetrofitCreateHelper.createApi(RedBag.class, Host.HOST).postceshi1(postmap);
                        postceshi.enqueue(new Callback<NullBean>() {
                                @Override
                                public void onResponse(Call<NullBean> call, Response<NullBean> response) {
                                        LogUtil.debugLog("11111111111");
                                }

                                @Override
                                public void onFailure(Call<NullBean> call, Throwable t) {
                                        LogUtil.debugLog("22222222222");
                                        LogUtil.debugLog(t.toString());
                                }
                        });
                        return ;
                }
        }













}
